package com.holly.unit.bpmn.modular.activiti.controller;

import com.holly.unit.bpmn.activiti.ActivitiOperator;
import com.holly.unit.bpmn.activiti.pojo.ActEntranceRequest;
import com.holly.unit.bpmn.activiti.pojo.dto.ActEntranceDTO;
import com.holly.unit.core.pojo.request.BaseRequest;
import com.holly.unit.core.pojo.response.ResponseData;
import com.holly.unit.core.pojo.response.SuccessResponseData;
import com.holly.unit.scanner.api.annotation.ApiResource;
import com.holly.unit.scanner.api.annotation.GetResource;
import com.holly.unit.scanner.api.annotation.PostResource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

 /**
 * @Description: 入口管理
 * @Author: holly
 * @Date:   2022-03-21 02:44:34
 * @Version: V1.0
 */
@RestController
@ApiResource(name = "入口管理")
@Api(tags = "入口管理")
public class ActEntranceController {

     @Resource
     private ActivitiOperator operator;

	/**
     * 添加
     * @param actEntranceRequest
     * @return
     */
    @ApiOperation(value = "入口管理_增加" ,notes = "入口管理_增加")
    @PostResource(name = "入口管理_增加", path = "/ActEntrance/add", requiredPermission = false , requiredLogin = false)
    public ResponseData add(@RequestBody @Validated(BaseRequest.add.class) ActEntranceRequest actEntranceRequest) {
        operator.add(actEntranceRequest);
    	return new SuccessResponseData();
    }

    /**
     * 编辑
     * @param actEntranceRequest
     * @author holly
     * @date 2022-03-21 02:44:34
     */
    @ApiOperation(value = "入口管理_编辑" ,notes = "入口管理_编辑")
    @PostResource(name = "入口管理_编辑", path = "/ActEntrance/edit", requiredPermission = false , requiredLogin = false)
    public ResponseData edit(@RequestBody @Validated(ActEntranceRequest.edit.class) ActEntranceRequest actEntranceRequest) {
        operator.edit(actEntranceRequest);
        return new SuccessResponseData();
    }
	
	/**
     * 删除
     * @author holly
     * @date 2022-03-21 02:44:34
     */
    @ApiOperation(value = "入口管理_删除" ,notes = "入口管理_删除")
    @PostResource(name = "入口管理_删除", path = "/ActEntrance/delete", requiredPermission = false , requiredLogin = false)
    public ResponseData delete(@RequestBody @Validated(ActEntranceRequest.delete.class) ActEntranceRequest actEntranceRequest) {
        operator.del(actEntranceRequest);
        return new SuccessResponseData();
    }

	/**
     * 详情
     * @author holly
     * @date 2022-03-21 02:44:34
     */
    @ApiOperation(value = "入口管理_详情" ,notes = "入口管理_详情")
    @PostResource(name = "入口管理_详情", path = "/ActEntrance/detail", requiredPermission = false , requiredLogin = false)
    public ResponseData detail(@RequestBody @Validated(ActEntranceRequest.detail.class) ActEntranceRequest actEntranceRequest) {
        ActEntranceDTO actEntrance = operator.detail(actEntranceRequest);
        return new SuccessResponseData(actEntrance);
    }
	
	/**
     * 分页列表查询
     * @author holly
     * @date 2022-03-21 02:44:34
     */
    @ApiOperation(value = "入口管理分页查询" ,notes = "入口管理分页查询")
    @GetResource(name = "入口管理分页查询", path = "/ActEntrance/page", requiredPermission = false , requiredLogin = false)
    public ResponseData page(ActEntranceRequest actEntranceRequest) {
        return new SuccessResponseData(operator.findPage(actEntranceRequest));
    }

	/**
     * 列表查询
     * @author holly
     * @date 2022-03-21 02:44:34
     */
    @ApiOperation(value = "入口管理列表查询" ,notes = "入口管理列表查询")
    @GetResource(name = "入口管理列表查询", path = "/ActEntrance/list", requiredPermission = false , requiredLogin = false)
    public ResponseData list(ActEntranceRequest actEntranceRequest) {
        return new SuccessResponseData(operator.findList(actEntranceRequest));
    }

}
